Chun-wei Fan [Fri, 30 Dec 2016 03:09:46 +0000 (11:09 +0800)]
Visual Studio builds: Drop the Broadway projects
Since the status of the GDK broadway backend is more or less unsupported,
drop the projects that build gtk4-broadwayd and gdk-broadway, and update
the projects to not to refer to them.
However, keep the Broadway configs for now as we will later transform
them to become configs for Vulkan, so bascially besides "installation"
parts and output settings, they will do the same as their Release|Debug
counterparts with no support for Broadway.
Chun-wei Fan [Thu, 29 Dec 2016 17:08:07 +0000 (01:08 +0800)]
Visual Studio builds: Include Vulkan sources in GSK
...but disable them for now. Configs will be added for the projects to
support Vulkan-enabled builds which will then enable the builds of these
sources. Extra commands and items will be needed for the GSK resources
along with ensuring GSK_RENDERER_GSK being defined for the build of GDK,
GDK-Win32 and GSK so that the builds of Vulkan-enabled builds can be done
properly.
Filter out the Vulkan sources from the 'dist hook' rules in
gsk/Makefile.am as we don't want to in turn include them twice in the
projects when the 'make dist' is performed on a system with Vulkan
builds enabled.
Stas Solovey [Thu, 29 Dec 2016 16:23:12 +0000 (16:23 +0000)]
Update Russian translation
(cherry picked from commit
c7dce1018b73621ca50a086430809a43f50909b4)
Matthias Clasen [Thu, 29 Dec 2016 16:07:05 +0000 (11:07 -0500)]
Avoid a possible crash in ::activate-url handlers
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.
Mario Blättermann [Thu, 29 Dec 2016 10:40:32 +0000 (10:40 +0000)]
Update German translation
Chun-wei Fan [Wed, 28 Dec 2016 14:37:01 +0000 (22:37 +0800)]
gsk: Fix build on Visual Studio
One cannot use #if...#endif within macro calls in Visual Studio and
possibly other compilers, and there are more uses of VLAs that need to be
replaced with g_newa().
There were also checks for the clip type in gskvulkanrenderpass.c which
were possibly not done right (using the address of the type value to check
for a type value), which triggered errors as one is attempting to compare
a pointer type to an enum/int type.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
Chun-wei Fan [Wed, 28 Dec 2016 14:34:04 +0000 (22:34 +0800)]
gdk/gdkvulkancontext.c: Avoid VLAs
During the drive to enable Vulkan context creation on Windows, some more
VLAs were found here. Replace them with g_newa().
https://bugzilla.gnome.org/show_bug.cgi?id=773299
Chun-wei Fan [Wed, 28 Dec 2016 14:25:07 +0000 (22:25 +0800)]
GDK/Win32: Support Vulkan context creation
This adds support to the GDK Win32 backend so that we can support Vulkan
context creation for use in the GSK Vulkan renderer, so that we can test
it on Windows platforms as well.
https://bugzilla.gnome.org/show_bug.cgi?id=776544
Chun-wei Fan [Mon, 26 Dec 2016 04:40:36 +0000 (12:40 +0800)]
gsk/gskrendernodeimpl.c: Avoid VLAs
Use g_newa() instead of VLAs, as VLAs may never be supported by some
compilers as it became optional in C11 and there are concerns about their
implementations in compilers that do support it.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
Gábor Kelemen [Tue, 27 Dec 2016 23:08:22 +0000 (23:08 +0000)]
Update Hungarian translation
Gábor Kelemen [Tue, 27 Dec 2016 22:57:31 +0000 (22:57 +0000)]
Update Hungarian translation
Benjamin Otte [Mon, 26 Dec 2016 23:33:34 +0000 (00:33 +0100)]
gsk: Add GSK_RENDERING_MODE=full-redraw
Forces a full redraw every frame.
This is done generically, so it's supported on every renderer.
For widget-factory first page (with the spinner spinning and progressbar
pulsing), I get these numbers per frame:
action clipped full redraw
snapshot 0ms 7-10ms
cairo rendering 0ms 10-15ms
Vulkan rendering 3-5ms 18-20ms
Vulkan expected * 0ms 1-2ms
GL rendering unsupported 55-62ms
* expected means disabling rendering of unsupported render nodes,
instead of doing fallback drawing. So it overestimates the performance,
because borders and box-shadows are disabled.
Benjamin Otte [Mon, 26 Dec 2016 23:18:52 +0000 (00:18 +0100)]
vulkan: Only render minimal region
It's faster to render once for every rectangle in the clip region than
rendering the outline of the clip region.
Especially because this reduces the time necessary to build up the frame
data.
In widget-factory (where we have 3 rectangles), this leads to a 5x
speedup in the rendering time rendering alone.
Snapshotting time goes from 10ms to ~1ms, which is another huge
improvement.
Benjamin Otte [Mon, 26 Dec 2016 21:24:22 +0000 (22:24 +0100)]
gdkvulkan: Track changes per swapchain image
... and use those in begin_frame() to ensure all of the invalid area
gets invalidated.
Benjamin Otte [Mon, 26 Dec 2016 16:11:13 +0000 (17:11 +0100)]
vulkan: Handle linear gradients
Note: We interpolate premultiplied colors as per the CSS spec. This i
different from Cairo, which interpolates unpremultiplied.
So in testcases with translucent gradients, it's actually Cairo that is
wrong.
Benjamin Otte [Mon, 26 Dec 2016 16:09:18 +0000 (17:09 +0100)]
tests: Add linear gradient test
Benjamin Otte [Mon, 26 Dec 2016 16:08:06 +0000 (17:08 +0100)]
tests: Add a patternspec argument for test creation
That way, I don't need to recreate all the tests I don't care about.
This is particularly useful when I want to change the size of the
testcase.
Benjamin Otte [Mon, 26 Dec 2016 16:07:24 +0000 (17:07 +0100)]
tests: Make rendernode --dump-variant actually work
Benjamin Otte [Mon, 26 Dec 2016 16:06:10 +0000 (17:06 +0100)]
gsk: Add missing Mozilla copyright header
I stole one of their shader functions, and if I steal, I might as well
do it right.
Benjamin Otte [Mon, 26 Dec 2016 16:04:56 +0000 (17:04 +0100)]
css: Handle repeating gradients with only one offset
Example:
repeating-linear-gradient(red 50%, blue 50%)
Those gradients in Firefox draw a solid image of the last color, so do
the same here.
Benjamin Otte [Mon, 26 Dec 2016 16:04:01 +0000 (17:04 +0100)]
gsk: Insist on ordered color stops
I don't want to sort them later for the shader preparation, so make
sure they come in ordered.
Benjamin Otte [Mon, 26 Dec 2016 13:49:34 +0000 (14:49 +0100)]
vulkan: Fix coordinate setup
This makes rendering textures work when the top left of the rendered
texture is not at (0, 0).
Benjamin Otte [Sun, 25 Dec 2016 18:51:30 +0000 (19:51 +0100)]
tests: Make sure number of runs is 1.
Daniel Boles [Mon, 26 Dec 2016 10:57:51 +0000 (10:57 +0000)]
Box: Restore an accidentally deleted comment
Also, split a MAX() onto its own line to match the others.
Daniel Boles [Sun, 25 Dec 2016 23:16:14 +0000 (23:16 +0000)]
Box: avoid recalc/reassignments, improve var names
Homogeneous branches repeated the calculation/assignment of the initial
space available to children. This avoids that by shuffling some code.
Perhaps more importantly, in doing that, I ended up with some ambiguous
names, and Company and I realised how vague the pre-existing naming was.
"size" becomes "extra_space", as this is what it represents. Conversely,
"extra" becomes "size_given_to_child" (albeit still given out in two
different ways depending on whether the Box is homogeneous). My hope is
that these sections of code are now somewhat less baffling than before!
Daniel Boles [Sun, 25 Dec 2016 17:43:06 +0000 (17:43 +0000)]
Box: Don't unnecessarily repeat a function call
The spacing was already saved in a variable just above.
djb [Sun, 25 Dec 2016 21:46:28 +0000 (21:46 +0000)]
tests: Remove executable bit from C files
Benjamin Otte [Sun, 25 Dec 2016 05:19:34 +0000 (06:19 +0100)]
tests: Fix logic to detect argument length
Benjamin Otte [Sun, 25 Dec 2016 05:18:42 +0000 (06:18 +0100)]
tests: Add a --runs argument to rendernode
This way we can rerun fast tests lots of times - not so much for
averaging times, but more for sysprof'ing.
Benjamin Otte [Sun, 25 Dec 2016 05:03:31 +0000 (06:03 +0100)]
tests: Add another test
In this test, Cairo is almost as fast as Vulkan. I wonder why.
Benjamin Otte [Sun, 25 Dec 2016 05:01:54 +0000 (06:01 +0100)]
vulkan: Add shader for color drawing with rectangle clip
Benjamin Otte [Sun, 25 Dec 2016 04:57:16 +0000 (05:57 +0100)]
vulkan: We use VK_FORMAT_B8G8R8A8_UNORM
... not SRGB. SRGB messes up alpha compositing, GdkRGBA and everything
else.
Marek Černocký [Sat, 24 Dec 2016 13:40:35 +0000 (14:40 +0100)]
Updated Czech translation
Benjamin Otte [Sat, 24 Dec 2016 05:16:54 +0000 (06:16 +0100)]
vulkan: Add proof-of-concept clip implementation
We can now clip to cicular rounded rectangles when drawing colors.
Benjamin Otte [Sat, 24 Dec 2016 03:58:51 +0000 (04:58 +0100)]
vulkan: Fold clip into push constants
As a side effect, the clipping data is now available inside shaders.
Not that any shader would use them yet, but they could!
Benjamin Otte [Sat, 24 Dec 2016 03:10:00 +0000 (04:10 +0100)]
vulkan: Change handling of push constants
Instead of storing the wire format, store the true structs and only
convert to the wire format when needed.
Benjamin Otte [Fri, 23 Dec 2016 23:52:07 +0000 (00:52 +0100)]
gsk: Add debug category for fallbacks
... and use it for the cases in Vulkan where we fall back to Cairo.
Benjamin Otte [Fri, 23 Dec 2016 20:36:17 +0000 (21:36 +0100)]
gsk: Add GskVulkanClip
This is now tracking the clips added by the clip nodes.
If any particular node can't deal with a clip, it falls back to Cairo
rendering. But if it can, it will render it directly.
Benjamin Otte [Fri, 23 Dec 2016 22:16:30 +0000 (23:16 +0100)]
iconhelper: Invalidate style before accessing texture
Invalidating the style might cause invalidation of the texture. So we
end up with a pointer to freed memory.
SAD!
Benjamin Otte [Fri, 23 Dec 2016 21:19:56 +0000 (22:19 +0100)]
vulkan: Try combining draw calls
This gives a 5-7% speedup in the case where we're just drawing N colors
and nothing else. So it;s not tremendously useful, but noticeable.
Garrett Regier [Fri, 23 Dec 2016 12:08:43 +0000 (04:08 -0800)]
gsk: Fix memory leak in gsk_render_node_write_to_file()
Piotr Drąg [Fri, 23 Dec 2016 15:18:23 +0000 (16:18 +0100)]
Update POTFILES.in
Benjamin Otte [Fri, 23 Dec 2016 11:07:22 +0000 (12:07 +0100)]
calendar: Implement snapshot()
Benjamin Otte [Fri, 23 Dec 2016 10:30:09 +0000 (11:30 +0100)]
tests: Improve rendernode test further
- Print benchmark output in fallback path
- Always run rendering, even when no filename given
- Don't require a filename when running with --benchmark
Benjamin Otte [Fri, 23 Dec 2016 10:11:52 +0000 (11:11 +0100)]
cellrenderer: Remove render() vfunc
Make the last 2 cell renderers create the cairo node themselves.
Benjamin Otte [Fri, 23 Dec 2016 09:50:04 +0000 (10:50 +0100)]
cellrendererpixbuf: Implement snapshot()
Benjamin Otte [Fri, 23 Dec 2016 09:44:49 +0000 (10:44 +0100)]
cellrendererprogress: Implement snapshot()
Benjamin Otte [Fri, 23 Dec 2016 08:31:54 +0000 (09:31 +0100)]
cellrenderertoggle: Implement snapshot()
Benjamin Otte [Fri, 23 Dec 2016 08:23:07 +0000 (09:23 +0100)]
cellrenderertext: Implement snapshot()
Benjamin Otte [Fri, 23 Dec 2016 08:09:42 +0000 (09:09 +0100)]
cellrenderer: Move snapshotting down into cell renderers
Now that every call to GtkCellArea is a snapshot call and no more cairo
calls are left, move the actual differentiation between Cairo and
Snapshot down to the cell renderer.
Benjamin Otte [Fri, 23 Dec 2016 07:08:17 +0000 (08:08 +0100)]
tests: Add rendernode-create-tests
Little tool that creates a bunch of test files to throw add the
rendernode binary.
They should really be part of a testsuite, but we have none, so OI just
put them here.
Benjamin Otte [Fri, 23 Dec 2016 07:03:36 +0000 (08:03 +0100)]
gsk: Add docs and error handling to serialization API
Benjamin Otte [Fri, 23 Dec 2016 06:07:59 +0000 (07:07 +0100)]
tests: Add some command-line flags to rendernode
Benjamin Otte [Fri, 23 Dec 2016 04:58:07 +0000 (05:58 +0100)]
gsk: Add gsk_render_node_write_to_file()
For when you're in a debugger and need to have a closer look at this
node...
Benjamin Otte [Fri, 23 Dec 2016 04:56:17 +0000 (05:56 +0100)]
gsk: Warn on cairo errors during gsk_render_node_draw()
It's the same warning we use inside GTK for when stuff weirdly goes
wrong.
Benjamin Otte [Fri, 23 Dec 2016 01:05:54 +0000 (02:05 +0100)]
gsk: Include config.h
The more you know:
Not including config.h causes the public API implemented in this file to
not be exported in the resulting library.
Benjamin Otte [Thu, 22 Dec 2016 19:01:52 +0000 (20:01 +0100)]
gsk: Implement gsk_renderer_render_texture() on GL
Benjamin Otte [Thu, 22 Dec 2016 18:01:07 +0000 (19:01 +0100)]
vulkan: Implement gsk_renderer_render_texture()
Benjamin Otte [Thu, 22 Dec 2016 17:58:55 +0000 (18:58 +0100)]
tests: Use gsk_renderer_render_texture()
Only keep the version that calls gsk_render_node_draw() if people
specify the --fallback option.
The actual renderer selection works just as for regular GTK. The easiest
way to influence it is setting the GSK_RENDERER environment variable.
Benjamin Otte [Wed, 21 Dec 2016 21:11:52 +0000 (22:11 +0100)]
gsk: Add gsk_texture_download() API
Now users can download pixels and make everything slooooooow.
Benjamin Otte [Wed, 21 Dec 2016 21:11:25 +0000 (22:11 +0100)]
gdk: Export gdk_cairo_surface_paint_pixbuf() into private header
Benjamin Otte [Wed, 21 Dec 2016 19:31:24 +0000 (20:31 +0100)]
docs: Add GskTexture
Benjamin Otte [Wed, 21 Dec 2016 19:28:21 +0000 (20:28 +0100)]
gsk: Rename to gsk_texture_download_surface()
I want to reuse the name gsk_texture_download() for downloading the
actual bytes.
Benjamin Otte [Wed, 21 Dec 2016 19:23:46 +0000 (20:23 +0100)]
gsk: Add gsk_renderer_render_texture()
... and implement it for the Cairo renderer.
It's an API that instructs a renderer to render to a texture.
So far this is mostly meant to be used for testing, but I could imagine
it being useful for rendering DND icons.
Benjamin Otte [Wed, 21 Dec 2016 19:07:16 +0000 (20:07 +0100)]
gskcairo: Don't store the viewport in the global struct
Just query it locally.
Benjamin Otte [Wed, 21 Dec 2016 17:14:51 +0000 (18:14 +0100)]
gsk: Don't overdraw with transparent
That code doesn't do anything.
And what the code should be doing (clearing the abckground) isn't
necessary as cairo drawing is guaranteed to clear the surface.
Benjamin Otte [Wed, 21 Dec 2016 12:32:32 +0000 (13:32 +0100)]
rendernode: Fix typo
Benjamin Otte [Wed, 21 Dec 2016 08:49:43 +0000 (09:49 +0100)]
gsk: Remove nonexisting functions
The function was removed when gsk_render_node_draw() was and
gsk_renderer_realize() was refactored respectively.
Benjamin Otte [Wed, 21 Dec 2016 06:20:28 +0000 (07:20 +0100)]
tests: Add a simple test to convert rendernode to png
Takes a rendernode file, outputs a PNG. Nothing more.
Benjamin Otte [Wed, 21 Dec 2016 06:20:28 +0000 (07:20 +0100)]
gsk: Export gsk_render_node_get_bounds()
I'll need it in tests/testsuite soon.
Benjamin Otte [Wed, 21 Dec 2016 05:50:39 +0000 (06:50 +0100)]
inspector: Add a render node save button
Now we can select buggy nodes, save them to a file, and add that file to
our testsuite.
Benjamin Otte [Wed, 21 Dec 2016 04:43:14 +0000 (05:43 +0100)]
gsk: Add gsk_render_node_serialize/deserialize()
This does a conversion to/from GBytes and is intended for writing tests.
It's really crude but it works.
And that probably means Alex will (ab)use it for broadway.
Benjamin Otte [Wed, 21 Dec 2016 04:30:31 +0000 (05:30 +0100)]
gsk: Remove spread member from GskShadow
I had originally thought I'd use GskShadow for box-shadow, but didn't in
the end.
So now it's only used for text-shadow and icon-shadow, and those don't
have a spread.
Marek Černocký [Thu, 22 Dec 2016 22:50:53 +0000 (23:50 +0100)]
Updated Czech translation
Benjamin Otte [Thu, 22 Dec 2016 02:35:24 +0000 (03:35 +0100)]
treeview: Port rest of stuff to snapshot()
The only thing still drawn with Cairo are grid lines.
Benjamin Otte [Thu, 22 Dec 2016 01:29:22 +0000 (02:29 +0100)]
treeview: Partially convert to snapshot()
The big fat scary bin drawing function that actually draws the cell
renderers - that one is still missing.
Chun-wei Fan [Wed, 21 Dec 2016 03:48:56 +0000 (11:48 +0800)]
gtkcssimagelinear.c: Avoid VLAs
VLAs are not supported by Visual Studio and possibly other compilers that
are supported by GTK+-3.90+, and probably never will be, although it is a
C99 specification, and it became optional for C11. It is also not a part
of the newer compiler requirements that are listed out for GTK+-3.90.x.
There exist concerns about the implementation of VLAs in compilers that
support them as well, so change it to a g_newa() approach.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
Matthias Clasen [Wed, 21 Dec 2016 15:17:09 +0000 (10:17 -0500)]
3.89.2
Matthias Clasen [Wed, 21 Dec 2016 19:12:17 +0000 (14:12 -0500)]
Fix distcheck
Matthias Clasen [Wed, 21 Dec 2016 17:03:05 +0000 (12:03 -0500)]
Fixes for the gdk docs
Matthias Clasen [Wed, 21 Dec 2016 15:58:10 +0000 (10:58 -0500)]
Make gsk docs build
Rico Tzschichholz [Wed, 21 Dec 2016 17:16:34 +0000 (18:16 +0100)]
snapshot: Fix some annoations
Rico Tzschichholz [Wed, 21 Dec 2016 17:15:50 +0000 (18:15 +0100)]
Alexander Larsson [Wed, 21 Dec 2016 11:20:56 +0000 (12:20 +0100)]
GskRenderNode: Use C99 flexible arrays to avoid extra allocation
Instead of a separate allocation for any arrays in the render node
we allocate these as part of the render node itself, using C99
flexible arrays.
This leads to less allocations, which is nice, but the major reason
for this is that it allows us to change the allocation scheme further
in the future. For instance, we want to do stack-like allocation so
that all the render-nodes for an entire frame are allocated in one
(or a few) chunks.
Alexander Larsson [Wed, 21 Dec 2016 10:21:38 +0000 (11:21 +0100)]
gsk: Add bounds member to RenderNode
Instead of constantly recalculating this (especially recursively for
parents!) we do it only on construction, because everything is
immutable anyway. Also, most nodes had a bounds already and can
use the new parent member instead.
We also do direct access to the node bounds rather than calling
gsk_render_node_get_bounds in various places, which means
we do less copying.
Alexander Larsson [Wed, 21 Dec 2016 10:00:18 +0000 (11:00 +0100)]
gsk: Drop gsk_render_node_make_immutable, nodes are always immutable
Alexander Larsson [Wed, 21 Dec 2016 09:59:35 +0000 (10:59 +0100)]
gsk docs: gsk_render_node_iter_get_type doesn't exist anymore
Baurzhan Muftakhidinov [Wed, 21 Dec 2016 10:56:38 +0000 (10:56 +0000)]
Update Kazakh translation
Christian Kirbach [Tue, 20 Dec 2016 19:11:29 +0000 (19:11 +0000)]
Update German translation
(cherry picked from commit
e0856226c580191805f58d0df10260df6b293df9)
Benjamin Otte [Tue, 20 Dec 2016 18:20:02 +0000 (19:20 +0100)]
debug: Add GTK_DEBUG=snapshot
This causes the snapshotting algorithm to dump all widget nodes into
their own container node. We then name that group accordingly (ie
"GtkSwitch<0xdeadbeef>") so you can easily see which node belongs where.
The feature is toggleable in the inspector's visual tab.
There's a few problems with it, becuse GtkSnapshot optimized container
nodes away if they are not needed, so we are losing some widgets...
Benjamin Otte [Tue, 20 Dec 2016 18:06:07 +0000 (19:06 +0100)]
revealer: Implement snapshot()
The revealer needs to clip the child during animations, whcih draw() did
automatically, but snapshot() does not.
Benjamin Otte [Tue, 20 Dec 2016 18:00:07 +0000 (19:00 +0100)]
API: Export gtk_container_snapshot_child()
It's equivalent to gtk_container_propagate_draw() and then one is
public, too.
Benjamin Otte [Tue, 20 Dec 2016 17:30:14 +0000 (18:30 +0100)]
debug: Remove pixel-cache debug categories
We have no more pixel cache, so they are kind of useless.
Debarshi Ray [Tue, 20 Dec 2016 11:55:41 +0000 (12:55 +0100)]
flowbox: Don't emit child-activated while dragging the pointer
https://bugzilla.gnome.org/show_bug.cgi?id=776306
Benjamin Otte [Mon, 19 Dec 2016 22:30:02 +0000 (23:30 +0100)]
cssimageradial: Handle "partial" gradients correctly
When the first/last color stop is not at 0%/100%, we need to start the
repeating at their offsets and not at 0%/100%.
Attached reftest demonstrates the problem.
Benjamin Otte [Mon, 19 Dec 2016 19:04:52 +0000 (20:04 +0100)]
searchbar: Implement snapshot()
Benjamin Otte [Mon, 19 Dec 2016 18:45:34 +0000 (19:45 +0100)]
gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.
All gadgets are snapshot now.
Benjamin Otte [Mon, 19 Dec 2016 18:30:55 +0000 (19:30 +0100)]
colorswatch: Implement snapshot
Benjamin Otte [Mon, 19 Dec 2016 18:19:15 +0000 (19:19 +0100)]
roundedbox: Add gtk_rounded_boxes_init_for_style()
Instead of making people intiialize a rectangle and then applying border
radius manually, provide a constructor that does it for them.
While doing that, also allow people to instead request the padding box
or the content box.
Refactor all relevant code to use this new constructor.
Benjamin Otte [Mon, 19 Dec 2016 17:46:24 +0000 (18:46 +0100)]
gtk: Remove GtkJunctionSides